package com.hl.sfzy.controller.course;

import com.hl.sfzy.entity.course.Courseorder;
import com.hl.sfzy.service.course.CourseOrderService;
import com.hl.sfzy.utils.R;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: sfzy
 * @description:
 * @author: xiaoyan
 * @create: 2024-09-11 11:46
 **/

@RestController
@RequestMapping("/order")
public class CourseOrderController {

    @Autowired
    private CourseOrderService courseOrderService;

    @PostMapping("/money")
    public R insertOrder(@RequestBody Courseorder courseorder){
        int i = courseOrderService.insertOrder(courseorder);
        return R.success(i);
    }

     @GetMapping("/selectCourse")
    public R selectOrder(Long courseId, Long userId){
         Courseorder courseorder = courseOrderService.SelectOrder(courseId,userId);
         return R.success(courseorder);
    }




}
